import React, { useEffect, useState } from 'react'

export default function App() {
  let [changeOpacity , setChangeOpacity] = useState(1);
  useEffect(() => {
    const changeNum  = setInterval(() => {
      changeOpacity -= 0.1;
      if(changeOpacity <= 0){
        changeOpacity =1 
      }
      setChangeOpacity(changeOpacity)
    },200)
    return () => {
      clearInterval(changeNum)
    }
  },[])
  return (
    <div>
      <h1 style = {{opacity : changeOpacity}}>每天都干活我感觉我都虚啦</h1>
    </div>
  )
}
